package com.hfkh;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class No_8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = (int)(Math.random()*100+1);
        System.out.println(num);
        System.out.print("请输入你想猜的数字：");
        int counter = 0;
        for (int i =1;i<20;i--,counter++){
            int guessNum = sc.nextInt();
            if (num>guessNum){
                System.out.print("猜的太小了，请继续猜测吧:");
            }
            else if (num<guessNum){
                System.out.print("猜的太大了，请继续猜测吧:");
            }
            else if (num==guessNum){
                if (counter==1){
                    System.out.println("你太有才了！");
                }
                else if (counter<=6&&counter>=2){
                    System.out.println("这么快就猜出来了，很聪明么！");
                }
                else if (counter>7){
                    System.out.println("猜了半天才猜出来，小同志，尚需努力啊！");
                }
                else if (counter>=20){
                    break;
                }
            }
        }

    }
}
